package com.spring.sd.ignore;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

@Component
public class AwareTest implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

        // 忽略接口为InterfaceTest的依赖，即不会自动装配，那么A中的c属性就是null
        beanFactory.ignoreDependencyInterface(InterfaceTest.class);
    }
}
